package com.king.rang;

import io.xjar.XEntryFilter;
import io.xjar.XKit;
import io.xjar.boot.XBoot;
import io.xjar.jar.XJarAntEntryFilter;
import io.xjar.key.XKey;

public class ToolUtils {

    public static void main(String[] args){

        try {

            if (args == null || args.length<3){
                System.out.println("必须三个参考");
                return;
            }

            XEntryFilter not  = XKit.not(
                    XKit.or()
                            .mix(new XJarAntEntryFilter("static/**"))
                            .mix(new XJarAntEntryFilter("templates/**"))
            );

            // Spring-Boot Jar包加密
            String password = args[0];
            XKey xKey = XKit.key(password);
            XBoot.encrypt(args[1], args[2], xKey,not);

            System.out.println("package success");
        }catch (Exception ex){
            ex.printStackTrace();
            System.out.println("打包异常 exception");
        }

    }

}
